package com.ztr.designpatterns.singleton;

public class LazySingletonSingleton {
    private LazySingletonSingleton(){}
    //静态内部类
    private static class HolderClass{
        private final static LazySingletonSingleton instance = new LazySingletonSingleton();
    }
    public static LazySingletonSingleton getInstance(){
        return HolderClass.instance;
    }
    public static void main(String args[]){
        LazySingletonSingleton s1,s2;
        s1 = LazySingletonSingleton.getInstance();
        s2 = LazySingletonSingleton.getInstance();
        System.out.println(s1 == s2);
    }

}
